(function($) {
	var SearchForm 	= {
		init: function() {
			this.bindSearchFormSubmit();
			this.bindKeyWordInputChange();
			this.bindKeywordInputClick();
		},
		bindSearchFormSubmit: function() {
			$("#search_btn_id").click(function() {
				var keyword 	= $("#keyword_id").val();
				if(!keyword || keyword == "请输入关键字...") {
					alert("关键字不能为空！");
					$("#keyword_id").focus();
					return false;
				}
				$("#search_form_id").submit();
			});
		},
		bindKeywordInputClick: function() {
			$("#keyword_id").click(function() {
				var keyword 	= $(this).val();
				if(keyword == "请输入关键字...") {
					$(this).val("");
					$(this).css("color", "#000");
				}
			});
		},
		bindKeyWordInputChange: function() {
			$("#keyword_id").css("color", "#ccc");
			$("#keyword_id").bind("change blur", function() {
				var keyword 	= $(this).val();
				if(keyword == "") {
					$(this).val("请输入关键字...");
					$(this).css("color", "#ccc");
				}
			});
		}
	};
	HHJsLib.register(SearchForm, SearchForm.init, 'init');
})(jQuery);